project(finalproject)

cmake_minimum_required(VERSION 2.8)
set(QT_USE_QTXML true)
set(QT_USE_QTXMLPATTERNS true)
find_package(Qt4 4.6 REQUIRED)
include(${QT_USE_FILE})
include_directories(${QT_INCLUDE_DIR})

set(final_SOURCES main.cpp
			   race.cpp
			   racefactory.cpp
			   raceprocessor.cpp
			   trainer.cpp
			   trainerfactory.cpp
			   trainerprocessor.cpp
			   speed.cpp
			   speedfactory.cpp
			   endurance.cpp
			   endurancefactory.cpp
			   allaround.cpp
			   allaroundfactory.cpp)
			   
set(final_MOC_HEADERS race.h
				   racefactory.h
				   raceprocessor.h
				   trainer.h
				   trainerfactory.h
				   trainerprocessor.h
				   speed.h
				   speedfactory.h
				   endurance.h
				   endurancefactory.h
				   allaround.h
				   allaroundfactory.h)
				   
set(final_RESOURCES races.qrc trainers.qrc)
set(final_MISC_FILES races.xsd races.xml trainers.xsd trainers.xml)

set_source_files_properties(races.qrc
							PROPERTIES OBJECT_DEPENDS "races.xsd")
set_source_files_properties(trainers.qrc
							PROPERTIES OBJECT_DEPENDS "trainers.xsd")

qt4_add_resources(final_RC_FILE ${final_RESOURCES})

qt4_wrap_cpp(final_MOC_SOURCES ${final_MOC_HEADERS})

add_executable(horse
               ${final_SOURCES}
               ${final_MOC_HEADERS}
               ${final_MOC_SOURCES}
               ${final_RC_FILES}
               ${final_RESOURCES}
               ${final_MISC_FILES})

target_link_libraries(horse ${QT_LIBRARIES})
